import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/Login.vue'
import Home from '@/views/home.vue'
import User from '@/views/user/users.vue'
import Hello from '@/views/user/hello.vue'
import Right from '@/views/right/right.vue'
import Role from '@/views/right/role.vue'
import Reports from '@/views/reports/Reports.vue'


import Goods from '@/views/goods/goods.vue'
import Lists from '@/views/goods/lists.vue'
import Add from '@/views/goods/add.vue'


import Categories from '@/views/goods/categories.vue'


Vue.use(Router)

export default new Router({
  routes: [{
      name: 'Login',
      path: '/login',
      component: Login
    },
    {
      name: 'home',
      path: '/',
      component: Home,
      children: [{
          name: 'Hello',
          path: '/',
          component: Hello
        },
        {
          name: 'User',
          path: 'users',
          component: User
        },
        {
          name: 'Right',
          path: 'rights',
          component: Right
        },
        {
          name: 'Role',
          path: 'roles',
          component: Role
        },
        {
          name: 'Goods',
          path: 'goods',
          component: Goods,
          redirect:{path:'goods/lists'},
          children:[
            {name:'Lists',path:'lists',component:Lists},
            {name:'Add',path:'add',component:Add}
          ]
        },
        {
          name: 'Categories',
          path: 'categories',
          component: Categories
        },
        {
          name: 'Reports',
          path: 'reports',
          component: Reports
        }
      ]
    }
  ]
})
